using System;
using System.Collections.Generic;
using Agriculture.Domain;
using MediatR;

namespace Agriculture.Api.Read.Application.Command
{
    /// <summary>
    /// 退款申请查询命令
    /// </summary>
    public class RefundApplicationQuery : IRequest<RefundApplicationQueryResult>
    {
        /// <summary>
        /// 患者姓名或手机号（用于模糊查询）
        /// </summary>
        public string? UserSearch { get; set; }

        /// <summary>
        /// 申请开始时间
        /// </summary>
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// 申请结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }

        /// <summary>
        /// 状态（0：全部，1：待处理，2：已处理，3：已拒绝）
        /// </summary>
        public int? Status { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { get; set; } = 10;
    }

    /// <summary>
    /// 退款申请查询结果
    /// </summary>
    public class RefundApplicationQueryResult
    {
        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPages { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int CurrentPage { get; set; }

        /// <summary>
        /// 退款申请列表
        /// </summary>
        public List<RefundApplicationDto> RefundApplications { get; set; } = new List<RefundApplicationDto>();
    }

    /// <summary>
    /// 退款申请DTO
    /// </summary>
    public class RefundApplicationDto
    {
        /// <summary>
        /// 服务编号
        /// </summary>
        public string ServiceNo { get; set; }

        /// <summary>
        /// 申请时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 用户手机号
        /// </summary>
        public string UserPhone { get; set; }

        /// <summary>
        /// 退款金额
        /// </summary>
        public decimal RefundAmount { get; set; }

        /// <summary>
        /// 来源（图文问诊/视频问诊/电话问诊/挂号预约）
        /// </summary>
        public string Source { get; set; }

        /// <summary>
        /// 退款状态（待处理/已处理/已拒绝）
        /// </summary>
        public string Status { get; set; }

        /// <summary>
        /// 处理时间
        /// </summary>
        public DateTime? ProcessTime { get; set; }

        /// <summary>
        /// 订单ID
        /// </summary>
        public int OrderId { get; set; }

        /// <summary>
        /// 订单编号
        /// </summary>
        public string OrderNo { get; set; }
    }
} 